from flask import Flask
from flask_sqlalchemy import SQLAlchemy

from flask_migrate import Migrate
from config import BaseConfig

db = SQLAlchemy()

def create_app(): # flask run
    app =  Flask(__name__)
    # app.config.from_pyfile('config.py')
    app.config.from_object(BaseConfig)
    db.init_app(app)

    from pro_name.user import user_bp
    app.register_blueprint(user_bp)
    Migrate(app,db)
    return app

if __name__ == '__main__':
    app.run(debug=True)